import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "login",
    component:() => import('@/views/login.vue')
  },
  {
    path: "/registered",
    name: "registered",
    component: () => import("@/views/registered.vue")
  }, {
    path: "/forgetPwd",
    name: "forgetPwd",
    component: () => import("@/views/forgetPwd.vue")
  },{
    path: "/index",
    name: "index",
    component:() => import('@/views/index.vue'),
    children:[
      {
        path: "/index/addressBook",
        name: "addressBook",
        component:() => import('@/views/addressBook')
      },{
        path: "/index/found",
        name: "found",
        component:() => import('@/views/found')
      },{
        path: "/index",
        name: "message",
        component:() => import('@/views/message')
      },{
        path: "/index/my",
        name: "my",
        component:() => import('@/views/my')
      }
    ]
  },{
    path: "/userInfo",
    name: "userInfo",
    component:() => import('@/views/my/userInfo')
  },{
    path: "/wallet",
    name: "wallet",
    component:() => import('@/views/my/wallet')
  },{
    path: "/privacySet",
    name: "privacySet",
    component:() => import('@/views/my/privacySet')
  },{
    path: "/set",
    name: "set",
    component:() => import('@/views/my/set')
  },{
    path: "/messageSet",
    name: "messageSet",
    component:() => import('@/views/my/messageSet')
  },{
    path: "/friendsCircle",
    name: "friendsCircle",
    component:() => import('@/views/found/friendsCircle')
  },{
    path: "/language",
    name: "language",
    component:() => import('@/views/my/language')
  }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
